package com.demo.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.demo.domain.ztm.User;
import com.demo.service.UserService;

@RestController
@Component
public class UserController {
	
//	@Resource
//	UserService userService;
//	
//	@RequestMapping(value="/{id}",method=RequestMethod.GET)
//	public String index(@PathVariable Integer id) {
//		User user = userService.getById(id);
//		
//		return "姓名："+user.getUserName()+"   密码："+user.getPassWord();
//	}
	@Reference(version = "1.0.0")
    private UserService userService;
	@RequestMapping(value="/{id}",method=RequestMethod.GET)
	public User getById(@PathVariable Integer id) {
		
		return userService.getById(id);
	}


}
